/*************************************************
 * File:    		SMJS.h
 * Author:  	HouJiong <hou_jiong@163.com>
 * Brief:   		StoneMoneky project.
 *
 * Copyright (c) HouJiong
 *
 *************************************************/

/*
 * History:
 * =======================================
 * 2009-04-10 HouJiong <hou_jiong@163.com> created
 */
 
#ifndef _SMJS_H_
#define _SMJS_H_

#include "SMtypedef.h"

#include <jsapi.h>


class SMJS
{
public:
	SMJS();
	~SMJS();
	
	bool loadJS(std::string jsfile);

	void callback(std::string func);
	
private:
	void	registerJS();
private:
	
	JSRuntime *rt;
	JSContext *cx;
	JSObject *globalObj;

};
#endif//_SMJS_H_